package com.atguigu.gulimall.auth;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.cloud.openfeign.EnableFeignClients;

/**
 * @EnableRedisHttpSession 核心原理
 * 1导入了RedisHttpSessionConfiguration配置
 *      1,SessionRepository=>RedisOperationsSessionRepository=>>配置了一个RedisOperationsSessionRepository，redis操作session,session的增删改查封装类
 *      2,SessionRepositoryFilter=>Filter:redis的session存储过滤器:每一个请求都要经过这个filter
 *          1,创建时自动从容器获取SessionRepository
 *          2,原始的request,response被包装,SessionRepositoryRequestWrapper,SessionRepositoryResponseWrapper
 *          3,以后获取session request.getSession()
 *          4,wrapperRequest.getSession()=>SessionRepository中获取到
 *   是装饰者模式:
 */
@EnableRedisHttpSession
@EnableFeignClients
@EnableDiscoveryClient
@SpringBootApplication
public class GulimallAuthServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(GulimallAuthServerApplication.class, args);
    }

}
